<script setup>
import { getCurrentInstance } from "vue";
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
const { proxy } = getCurrentInstance()
async function getInfo() {
  const res = await proxy.request('/account/get/user/info', {}, { method: 'GET' })
  if (res.code == 401) {
    uni.redirectTo({ url: '/pages/login' })
  }
}
onLaunch(() => {
  const token = uni.getStorageSync('token')
  if (token) {
    getInfo()

  }
});
onShow(() => {
  console.log("App Show");
});
onHide(() => {
  console.log("App Hide");
});
</script>
<style lang="scss">
@import "uview-plus/index.scss"
</style>
